package com.ruoyi.project.lely.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.R;
import com.ruoyi.project.lely.bean.dto.LyFeedbackDTO;
import com.ruoyi.project.lely.bean.entity.LyGoods;
import com.ruoyi.project.lely.constant.CommonConstant;
import com.ruoyi.project.lely.service.LyFeedbackService;
import com.ruoyi.project.lely.service.LyGoodsService;
import com.ruoyi.project.lely.service.LyIndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luoyong
 * @Desc: 类目菜单
 * @since 2022-01-13
 */
@Api(tags = "Mini-首页信息")
@RestController
@RequestMapping("/mini/home")
public class HomeController {

    @Autowired
    private LyIndexService indexService;
    @Autowired
    private LyGoodsService goodsService;
    @Autowired
    private LyFeedbackService feedbackService;

    @ApiOperation("商品数量")
    @GetMapping("/goodsCount")
    public R getGoodsCount() {
        return indexService.getGoodsCount();
    }

    @ApiOperation("查询首页数据")
    @GetMapping("/index")
    public R get() {
        return indexService.getIndex();
    }

    @ApiOperation("新增意见反馈")
    @PostMapping("/addFeedback")
    public R addFeedback(@RequestBody LyFeedbackDTO dto) {
        return feedbackService.add(dto);
    }


}

